'use strict';

/*
 * 主机路径
 */

var serverPath = location.origin,
appContextPath = "",
href = location.href,
appBasePath = serverPath + appContextPath
;
var arr = href.replace(serverPath, "").split('/');
if (arr.length >= 2) {
	appContextPath = arr[1];
	appBasePath = serverPath + "/" + appContextPath
}
/*
 * 应用中心路由配置 
 */
var appStatePrefix = "kernel.appList.";
var appUrlPrefix = "/appList";

/*
 * 配置 RequireJS
 */
requirejs.config({
	deps: ['main'],
    paths: {
    	domReady : appBasePath + '/third/require/domReady',
		jquery : appBasePath + '/resources/assets/jquery/1.11.3/jquery.min',
		// jqueryui : appBasePath + '/third/jquery-ui/jquery-ui.min',
		bootstrap : appBasePath + '/resources/js/bootstrap.min',
		datetimepicker : appBasePath + '/resources/js/bootstrap-datetimepicker',
		angular : appBasePath + '/third/angular/angular',
		angularUiRouter : appBasePath + '/third/angular/angular-ui-router/angular-ui-router.min',
		ocLazyLoad: appBasePath + '/third/angular/ocLazyLoad/ocLazyLoad',		
		uiRouterExtras: appBasePath + '/third/angular/ui-router-extras/ct-ui-router-extras',
		ngFileUpload: appBasePath + '/third/angular/ng-file-upload/ng-file-upload.min',
		
		select2 : appBasePath + '/resources/js/select2',
		common : appBasePath + '/resources/js/common',
		special : appBasePath + '/resources/js/special',
		model1 : appBasePath + '/resources/js/model1',
		model4 : appBasePath + '/resources/js/model4',
    },
	shim : {
		jquery: { exports: '$' },
		bootstrap: {exports : 'bootstrap', deps : ['jquery']},
		select2: {exports : 'select2', deps : ['jquery']},
		datetimepicker: {exports : 'datetimepicker', deps : ['bootstrap']},
		
		
		angular : {exports : 'angular', deps : ['datetimepicker', 'select2']},		
		angularUiRouter : {deps : ['angular']},
		ocLazyLoad: {deps: ['angular']},
		uiRouterExtras: {deps: ['angularUiRouter']},
		ngFileUpload: {deps: ['angular']},
		jqueryui: [{deps: ['jquery']}]
	}
});
